<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title><ui:insert name="title">Meringer</ui:insert>
</title>
<meta http-equiv="Pragma" content="no-cache"></meta>
<link rel="stylesheet" type="text/css" href="css/main.css"
	media="screen" />
<ui:insert name="custom">

</ui:insert>	

	
</h:head>

<h:body>
	<div class="wrapper">
		<div id="headerDiv">
				<div class="menu">
				 	<c:set scope="request" var="row" property="x" value="10"/>

		            
		            
		            		<ul class="menu-inside">
		            		<!-- TODO -->
		            		<!-- Home is not yet implemented -->
		            		<!--
		            		<c:if test="#{facesContext.externalContext.isUserInRole('user') or facesContext.externalContext.isUserInRole('admin')}">
								<li>
									<h:link outcome="home?faces-redirect=true" styleClass="current"> 
										<strong> 
											<strong>
												<span class="menu-text"> home </span>
											</strong>
										 </strong>
									</h:link>
								</li>	
							 </c:if>
							 -->
							 <c:if test="#{facesContext.externalContext.isUserInRole('user')}">		
								<li>
									<h:link outcome="garage?faces-redirect=true" styleClass="current"> 
										<strong> 
											<strong>
												<span class="menu-text"> garage </span>
											</strong>
										 </strong>
									</h:link>
								</li>
								<li>
									<h:link outcome="store?faces-redirect=true" styleClass="current"> 
										<strong> 
											<strong>
												<span class="menu-text"> store </span>
											</strong>
										 </strong>
									</h:link>
								</li>
								<li>
									<h:link outcome="chooseRace?faces-redirect=true" styleClass="current"> 
										<strong> 
											<strong>
												<span class="menu-text"> race </span>
											</strong>
										 </strong>
									</h:link>
								</li>
								<li>
									<h:link outcome="profile?faces-redirect=true" styleClass="current"> 
										<strong> 
											<strong>
												<span class="menu-text"> profile </span>
											</strong>
										 </strong>
									</h:link>
								</li>
							</c:if>
							
							<c:if test="#{facesContext.externalContext.isUserInRole('admin')}">
								<li>
									<h:link outcome="adminCarModels?faces-redirect=true" styleClass="current"> 
										<strong> 
											<strong>
												<span class="menu-text"> Car Models </span>
											</strong>
										 </strong>
									</h:link>
								</li>
								<li>
									<h:link outcome="adminRoads?faces-redirect=true" styleClass="current"> 
										<strong> 
											<strong>
												<span class="menu-text"> Roads </span>
											</strong>
										 </strong>
									</h:link>
								</li>
								<li>
									<h:link outcome="adminUsers?faces-redirect=true" styleClass="current"> 
										<strong> 
											<strong>
												<span class="menu-text"> Users </span>
											</strong>
										 </strong>
									</h:link>
								</li>	
							 </c:if>
							<c:if test="#{facesContext.externalContext.isUserInRole('user') or facesContext.externalContext.isUserInRole('admin')}">
								<li id="logout">
									<h:form id="dummyForm">
										<h:commandLink action="#{userBean.logout}" styleClass="current"> 
											<strong> 
												<strong>
													<span class="menu-text"> logout </span>
												</strong>
											 </strong>
										</h:commandLink>
									</h:form>
								</li>
							 </c:if>
							</ul>
				</div>
		</div>
		
		<div id="content">
			<div class="replace">
				<ui:insert name="content">
		    		Content area.  See comments below this line in the source.
				</ui:insert>
			</div>
		</div>
		<div id="footer">
			<div>Copyright © 2013 Boyan, Kalin, Valentin</div>
		</div>
	</div>
</h:body>

</html>
